import axios from "axios"
/**上传文件到7牛云**/
async function Upload2Qiniu(file){
  var result
  let formData = new FormData()
  formData.append('file', file.file)
  console.log(file.file)
  await axios({
   
      baseURL: 'api/common/upload',
      data: formData,
      headers: { 'Content-Type': 'multipart/form-data'},
      method: 'post',
  }).then(res => {
      result=res.data
      console.log(result);
  })
  return result
}

export default {
  name: 'UploadAPI',
  Upload2Qiniu,

}
